Skip to content

test: add property tests for modem and router parsers - #6

Draft
pjeweb wants to merge 1 commit into
mainfrom
osb/pr/fuzz-property-tests
Draft

pjeweb wants to merge 1 commit into
mainfrom
osb/pr/fuzz-property-tests

Conversation

@pjeweb

@pjeweb pjeweb commented Nov 22, 2026

Copy link
Copy Markdown

The parsers that take data from a modem ("ModemManager over D-Bus"), a router admin API or mmcli are covered by fixtures, so I could not tell what a malformed or hostile reply does to them. This adds fast-check properties that throw generated input at them.

  • Properties for the D-Bus body codec, the 3GPP location string, cell info, ModemManager observation normalization, the HiLink, goform and HIMI signal parsers, mmcli SMS output, NMEA and the small text parsers (/proc/net/dev, udev, usb-devices, versions).
  • They check that nothing throws on arbitrary input, that accepted values keep their bounds and round-trip, and that SMS refusals never echo message content.
  • bun test runs 300 cases per property. bun run --cwd control fuzz gives every property 8 seconds with the case count lifted.
  • fast-check is a dev dependency of control only; the published tarball is unchanged (verify:tarball passes).

The AT and MBIM framing is ModemManager's, so there is no AT or MBIM response parser in this repository to test; the properties cover what this repository does with the decoded D-Bus data and the router and CLI text it parses itself.

Results of my runs

One 8 second-per-property run (31 properties, about 4 minutes) did 67.4M cases with no failure. The same properties, once their generators were widened, found the four problems fixed in the PRs stacked on this one: malformed D-Bus signatures are accepted, a NaN signal reading breaks the serving-cell order, 3gpp-lac-ci tokens are not validated, and a JSON field named __proto__ disappears. Those properties are added with each fix. Five tests in the full suite (workspace package versions, two flock tests, two credential fences) fail on main in my checkout as well and are unrelated.

Properties for the D-Bus body codec, 3GPP location strings, cell info, ModemManager observation normalization, the router (HiLink, goform, HIMI) signal parsers, mmcli SMS output, NMEA and the small text parsers: nothing throws on arbitrary input, accepted values keep their bounds and round-trip. bun test runs 300 cases each; FUZZ_SECONDS gives every property a time budget for longer runs.
@pjeweb pjeweb added fork-only Downstream-specific change; this change is not intended for upstream. parked Parked or held for now; not planned for a train until picked up again. labels Nov 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fork-only Downstream-specific change; this change is not intended for upstream. parked Parked or held for now; not planned for a train until picked up again.

Development

Successfully merging this pull request may close these issues.

1 participant